define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.user/index',
        add_url: 'user.user/add',
        edit_url: 'user.user/edit',
        delete_url: 'user.user/delete',
        export_url: 'user.user/export',
        modify_url: 'user.user/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID'},
                    // {field: 'user_account', title: '账号'},
                    {field: 'user_nickname', title: '昵称'},
                    // {field: 'password', title: '密码'},
                    // {field: 'pay_password', title: '支付密码'},
                    // {field: 'user_pid', title: '用户上级'},
                    // {field: 'groups', title: '多级分销'},
                    // {field: 'level', title: '邀请层级'},
                    // {field: 'user_group', title: '用户类型'},
                    {field: 'mobile', title: '手机号'},
                    {field: 'invite_code', title: '邀请码'},
                    // {field: 'area_code', title: '地区代码'},
                    {field: 'avatar', title: '头像', templet: ea.table.image},
                    {field: 'gender', search: 'select', selectList: ea.getDataBrage('select_list_gender'), title: '性别'},
                    {field: 'email', title: '邮箱'},
                    // {field: 'birthday', title: '生日'},
                    // {field: 'user_level', title: '用户等级'},
                    // {field: 'last_login_time', title: '最后登录时间'},
                    // {field: 'last_login_ip', title: '最后登录ip'},
                    // {field: 'create_time', title: '创建时间'},
                    {field: 'status', search: 'select', selectList: ea.getDataBrage('select_list_status'), title: '状态', templet: ea.table.switch},
                    // {field: 'client_id', title: 'app的client_id'},
                    // {field: 'user_auth', title: '所属角色权限组'},
                    // {field: 'is_del', search: 'select', selectList: ea.getDataBrage('select_list_is_del'), title: '是否删除'},
                    // {field: 'source', search: 'select', selectList: ea.getDataBrage('select_list_source'), title: '用户注册平台'},
                    {width: 250, title: '操作', templet: ea.table.tool , fixed:'right'},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});